<?php
define('APP_NAME','MY_Yell');

include 'php-yell.php';

//print_r(user(10)->name);
//print_r(user(5));

/**/
app(APP_NAME
,function ($app) use ($_) { # APP EXISTS
    load('database',$app);

    $app -> browser = browser();
    //print_r($app);
    
    $_('      Hello Milky Way! (trimmed)       ')->Yell_string -> trim() -> out();
    echo "<br/><br/>\n\n";
    
    $_('      &nbsp;&nbsp;Hello Milky Way!&nbsp;(html space trimmed)&nbsp;&nbsp;       ')->Yell_string -> trim(' &nbsp;') -> out();
    echo "<br/><br/>\n\n";
    
    $_('      &nbsp;&nbsp;Hello Milky Way!&nbsp;(html space trimmed)&nbsp;&nbsp;       ')->Yell_string -> htrim() -> out();
    echo "<br/><br/>\n\n";
    
    $_('Hello Milky Way! (to lower)')->Yell_string -> lo() -> out();
    echo "<br/><br/>\n\n";
    
    $_('Hello Milky Way! (to upper)')->up()->out();
    echo "<br/><br/>\n\n";

    $array = array('text1','Text 2','texto THree');
    $_($array)->each(function ($key,$value) use ($_) {
        echo '$array['.$key.'] = '.$_($value) -> Yell_string -> up() -> out(TRUE);
        echo "<br/>\n";
    });
    echo "<br/><br/>\n\n";

    $_($array)->each(function ($key,$value) use ($_) {
        echo '$array['.$key.'] = '.$_($value) -> Yell_string -> lo() -> out(TRUE);
        echo "<br/>\n";
    });
    echo "<br/><br/>\n\n";
    
    return TRUE;
},function ($app) use ($_) { # APP NOT EXISTS
    echo 'Application not found.';
    
    return TRUE;
});
